#include <benchmark/benchmark.h>
#include "wchar.h"
#include "util.h"

using namespace std;

static void Bm_function_Wmemset(benchmark::State &state)
{
    wchar_t ch = 'N';
    wchar_t des[20];
    size_t count = 10;
    for (auto _ : state)
    {
        benchmark::DoNotOptimize(wmemset(des, ch, count));
    }

    state.SetItemsProcessed(state.iterations());
}

static void Bm_function_Wmemcpy(benchmark::State &state)
{
    wchar_t des[100];
    wchar_t source[] = L"com.ohos.mms";
    for (auto _ : state)
    {
        benchmark::DoNotOptimize(wmemcpy(des, source, sizeof(source)));
    }

    state.SetItemsProcessed(state.iterations());
}

MUSL_BENCHMARK(Bm_function_Wmemset);
MUSL_BENCHMARK(Bm_function_Wmemcpy);